package org.sunny.client;

import java.net.MalformedURLException;
import java.rmi.RemoteException;

import org.sunny.service.ServicePortBindingStub;
import org.sunny.service.ServiceServiceLocator;

public class TestClient {
	  public static void main(String[] args) throws MalformedURLException {  
		 try {
			 	//初始化对象
			 	ServiceServiceLocator service = new ServiceServiceLocator();
				 //链接WSDL说明书
		        java.net.URL url = new java.net.URL("http://127.0.0.1:9999/helloWord?wsdl");
		        ServicePortBindingStub stub = new ServicePortBindingStub(url, service);
		         //调用我们自己写的方法sayHello
		        String x2 = stub.sayHello("世界您好!");
		        System.out.println(x2);
	        
		 	} catch (RemoteException e) {
	        // TODO Auto-generated catch block20
	        e.printStackTrace();
	       } 
	  }
}
